package com.myajax;

import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;

public class JdomCreate {
	JdomCreate(){
		
	}
	
	public String makeXml(ResultSet rs)throws IOException,SQLException{
		StringBuffer returnXML = null;
		ResultSet rs_l=rs;
		if(rs_l.next()){
        returnXML = new StringBuffer("\r\n<emp-details>");
        returnXML.append("\r\n<id>"+
        		rs_l.getString("id")+"</id>");
        returnXML.append("\r\n<name>"+
                         rs_l.getString("name")+"</name>");
        returnXML.append("\r\n<sal>"+
                         rs_l.getString("sal")+"</sal>");
        returnXML.append("\r\n<dept>"+
                         rs_l.getString("dept")+"</dept>");
        returnXML.append("\r\n</emp-details>");
        }
		return(returnXML.toString());
	}
}